<c:if test="#{not empty contentIdToBeReRendered}"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:a4j="http://richfaces.org/a4j">

<ui:remove>
 Template rendering pagination control actions using ajax.

 Parameters :
  - contentIdToBeReRendered: mandatory id(s) of components to re-render. if
    empty, actions will not be displayed.
</ui:remove>

<a4j:region>
  <h:panelGroup
    layout="block" styleClass="pageNavigationControls"
    rendered="#{provider.nextPageAvailable or provider.previousPageAvailable}">

    <a4j:commandButton action="#{provider.rewind}"
                     alt="#{messages['command.navigation.rewind']}"
                     image="/icons/navigation_first.png"
                     render="#{contentIdToBeReRendered}" >
      <f:attribute name="disabled" value="#{not provider.previousPageAvailable}"/>
    </a4j:commandButton>
    <a4j:commandButton action="#{provider.previous}"
                     alt="#{messages['command.navigation.previous']}"
                     image="/icons/navigation_previous.png"
                     render="#{contentIdToBeReRendered}" >
      <f:attribute name="disabled" value="#{not provider.previousPageAvailable}"/>
    </a4j:commandButton>

    <h:panelGroup styleClass="currentPageStatus">
        <h:outputText
         value="#{(provider.resultsCount ge 0 or provider.currentPageIndex ge provider.pageLimit) ? provider.currentPageStatus : nxu:translate('command.navigation.status.unknownPageAmount', provider.currentPageIndex + 1, provider.pageLimit)}" />
    </h:panelGroup>

    <a4j:commandButton action="#{provider.next}"
                     alt="#{messages['command.navigation.next']}"
                     image="/icons/navigation_next.png"
                     render="#{contentIdToBeReRendered}" >
      <f:attribute name="disabled" value="#{not provider.nextPageAvailable}"/>
    </a4j:commandButton>

    <a4j:commandButton action="#{provider.last}"
                     alt="#{messages['command.navigation.fastforward']}"
                     image="/icons/navigation_last.png"
                     render="#{contentIdToBeReRendered}" >
      <f:attribute name="disabled" value="#{not provider.lastPageAvailable}"/>
    </a4j:commandButton>

    <a4j:status>
      <f:facet name="start">
        <h:graphicImage value="/img/standart_waiter.gif" />
      </f:facet>
      <f:facet name="stop">
        <h:graphicImage value="/icons/icon_spacer.gif" />
      </f:facet>
    </a4j:status>

  </h:panelGroup>


</a4j:region>

</c:if>